package com.spsy.pay.controller.mq;

import com.spsy.common.core.domain.R;
import com.spsy.pay.constant.RabbitMqConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 沈昕希  &&  (=￣ω￣=)m 
 * @Shen "再说错了又能怎么样呢？人生不就是由无数的错误组成的吗"
 * @xin  "我是个无聊的人，我有无数的缺点，我也并不喜欢我自己，甚至厌恶我自己"
 * @date 2025/9/23-19:29
 */
 @RestController
 @RequestMapping("/rabbit")
 @Slf4j
public class RabbitMqController {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @GetMapping("/send")
    public R send(){
        log.info("发送。。。。。。。。。");

        rabbitTemplate.convertAndSend(RabbitMqConstant.MQ_EXCHANGE,RabbitMqConstant.MQ_ROUTING,"云计算2302a-孙梦初");

        return R.ok();
    }
}
